package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func _file(context *gin.Context) {
	context.HTML(200, "index.html", gin.H{"username": "xxx"})
}
func _redirect(context *gin.Context) {
	context.Redirect(301, "https://www.baidu.com")
	context.Redirect(301, "/html")
}
func main() {
	router := gin.Default()
	router.StaticFile("/a1.png", "static/a1.jpg")
	router.StaticFS("/static", http.Dir("/static"))

	router.GET("/html", _file)
	router.GET("/redirect", _redirect)
	router.Run(":8080")
}
